<?php
/**
 * SKU价格采集数据模型
 *
 * PHP version 5
 *
 * @package    Ecga
 * @subpackage Models
 * @author     Garbin <garbing@gmail.com>
 * @copyright  2010 Xingchangxinda Inc.
 * @version    SVN: $id$
 */

namespace Project\Models\Mapper\Ecga;


use \Framework\Mapper\Models;
/**
 * SKU价格采集数据 models
 *
 * @package    Ecga
 * @subpackage Models
 * @author     FarmerLi <lixu_01@126.com>
 * @copyright  2010 Xingchangxinda Inc.
 * @version    Release: 0.1
 */
class SkuPriceLogs extends Models
{
	/**
	 * set SkuPriceLogs fields
	 *
	 * @return void
	 */
	protected function setFields()
	{
		$this->integerField('siteId');
		$this->charField('sku', 45);
		$this->urlField('skuUrl');
		$this->charField('title', 255);
		$this->decimalField('price');
		$this->integerField('sale');
		$this->tinyintegerField('batchNo');
		$this->dateField('logDatetime');
		$this->integerField('projectId');
        $this->foreignKey('skuInfo', __NAMESPACE__ . '\Skus', 'sku', 'sku');
        $this->virtualField('title', 'skuInfo');
        $this->virtualField('srp', 'skuInfo');
        $this->virtualField('mop', 'skuInfo');
	}
	
	/**
	 * 设置模型的关系
	 *
	 * @return void
	 */
	protected function setRelations()
	{
		
	}
}